package com.uzai.console.common.web.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.MDC;
import org.springframework.context.annotation.Configuration;

/**
 * @author mingyang.chen create in 2022/9/20 11:44
 */
@Configuration
public class FeignCommonHeaderInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header(TraceIdInterceptor.TRACE_ID, MDC.get(TraceIdInterceptor.TRACE_ID));
    }
}
